﻿using System;
using Extensions;
using OTS.Utility;

namespace OTS
{
    public partial class Kullanicilar : XForm
    {
        public Kullanicilar()
        {
            InitializeComponent();
        }

        private void Users_Load(object sender, EventArgs e)
        {
            System.Data.DataTable dt = OTS.Utility.AppSession.DataManager.ExecuteDataTable("GetKullanicilar");            
            dt.PrimaryKey = new System.Data.DataColumn[] { dt.Columns["KullaniciId"] };
            dt.Columns["KullaniciId"].AutoIncrement = true;
            dt.Columns["KullaniciId"].AutoIncrementSeed = -1;
            dt.Columns["KullaniciId"].AutoIncrementStep = -1;
            gvMaster.Init(dt);
            gvMaster.Columns["KullaniciId"].OptionsColumn.ReadOnly = true;
            gvMaster.FormatAsDate("Tarih");
            gvMaster.BestFitColumns();
            gvMaster.OptionsView.NewItemRowPosition = DevExpress.XtraGrid.Views.Grid.NewItemRowPosition.Bottom;
            gvMaster.MoveLast();

            btnKaydet.Click += btnKaydet_Click;
        }

        void btnKaydet_Click(object sender, EventArgs e)
        {
            gvMaster.Update("", "Kullanici");
            gvMaster.VeriyiGuncelle(true, "GetKullanicilar");
        }

    }
}
